package na.learn.java.threads;

public class StoppableThread implements Runnable {

	private boolean shouldStop = false;

	public void run() {
		int count = 1;
		while(!shouldStop)
		System.out.println("Thread :" + Thread.currentThread().getName() + "is RUNning for count " + count++ );
		System.out.println("Thread :" + Thread.currentThread().getName() + "  is STOPing" );

	}

	public boolean isShouldStop() {
		return shouldStop;
	}

	public void setShouldStop(boolean shouldStop) {
		this.shouldStop = shouldStop;
	}

}
